import java.util.Scanner;

public class demo1 {
    public static boolean is_Wan(int num) {
        if (num == 1) {
            return false;
        }
        int sum = 0;
        for (int i = 1; i < num; i++) {
            if (num % i == 0) {
                sum += i;
            }
        }
        if (sum == num) {
            return true;
        }
        return false;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt();
        int count = 0;
        for (int i = 1; i <= num; i++) {
            if (is_Wan(i)) {
                count++;
            }
        }
        System.out.println(count);
    }
}
